import request from '@/utils/request'
// 登录
export const sysRole = (params) => {
  return request({
    url: '/sys/role',
    params
  })
}
export const company = (id) => {
  return request({
    url: `/company/${id}`
  })
}
// 新增
export const sysRolePost = (data) => {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}
// 删除
export const sysRoleDel = (id) => {
  return request({
    url: '/sys/role/' + id,
    method: 'delete'
  })
}
// 编辑
export const sysRolePut = (data) => {
  return request({
    url: '/sys/role/' + data.id,
    method: 'put',
    data
  })
}
// 获取角色列表
export const sysRoleById = (id) => {
  return request({
    url: '/sys/role/' + id
  })
}
// 分配权限
export const sysRoleAssignPrem = (id, permIds) => {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data: {
      id,
      permIds
    }
  })
}
